package com.wcity.manage.common.vo.community.partybuilding;

import org.apache.commons.lang.StringUtils;

import java.util.Date;

/**
 * 党政建设
 * Created by hgg on 2016/12/14.
 */
public class PartyBuildingVo {

    private Integer id;

    /**
     * 标题
     */
    private String buildTitle;

    /**
     * 内容
     */
    private String buildContent;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 更新时间
     */
    private Date updateTime;

    /**
     * 所属社区管理员用户ID
     */
    private Integer userId;

    /**
     * 小区ID
     */
    private Integer blockId;

    /**
     * 内容
     */
    private String showBuildContent;

    /**
     * 小区名称
     */
    private String blockName;

    public PartyBuildingVo() {
    }

    public PartyBuildingVo(Integer id, String buildTitle, String buildContent, Date createTime, Date updateTime, Integer userId, Integer blockId) {
        this.id = id;
        this.buildTitle = buildTitle;
        this.buildContent = buildContent;
        this.createTime = createTime;
        this.updateTime = updateTime;
        this.userId = userId;
        this.blockId = blockId;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getBuildTitle() {
        return buildTitle;
    }

    public void setBuildTitle(String buildTitle) {
        this.buildTitle = buildTitle;
    }

    public String getBuildContent() {
        return buildContent;
    }

    public void setBuildContent(String buildContent) {
        this.buildContent = buildContent;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public Integer getBlockId() {
        return blockId;
    }

    public void setBlockId(Integer blockId) {
        this.blockId = blockId;
    }

    public String getShowBuildContent() {
        if( StringUtils.isNotBlank( buildContent ) && buildContent.length() > 15 ){
            return buildContent.substring( 0,14 ) + "...";
        }
        return buildContent;
    }

    public void setShowBuildContent(String showBuildContent) {
        this.showBuildContent = showBuildContent;
    }

    public String getBlockName() {
        return blockName;
    }

    public void setBlockName(String blockName) {
        this.blockName = blockName;
    }
}
